

    using SmartSoft.DAL;
    using System.Web.Services;
    using System;
    using System.Data;
    using System.Data.SqlClient;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WSCTVATDataAccess : System.Web.Services.WebService
{
    private CTVATDataAccess objDataAccess = new CTVATDataAccess();
    public WSCTVATDataAccess()
    {
    }


    [WebMethod]
    public int CheckInvoiceLock(string ps_Subsidiary, string ps_UserName, object ps_InvoiceOrder)
    {
        object[] arr = Validator.Validate(ps_InvoiceOrder);
        return objDataAccess.CheckInvoiceLock(ps_Subsidiary, ps_UserName, arr[0]);
    }

    [WebMethod]
    public int CheckInvoiceStatus(string ps_Subsidiary, string ps_UserName, object ps_InvoiceOrder)
    {
        object[] arr = Validator.Validate(ps_InvoiceOrder);
        return objDataAccess.CheckInvoiceStatus(ps_Subsidiary, ps_UserName, arr[0]);
    }

    [WebMethod]
    public bool Delete(string ps_UserName, object po_KeyCode)
    {
        object[] arr = Validator.Validate(po_KeyCode);
        return objDataAccess.Delete(ps_UserName, arr[0]);
    }

    [WebMethod]
    public DataTable GetDataRow(string ps_InvoiceOrder)
    {

        return SSDataAccess.ConvertRowToTable(objDataAccess.GetDataRow(ps_InvoiceOrder));
    }

    [WebMethod]
    public DataTable GetTableByMaster(string ps_MasterInvoiceOrder)
    {

        return objDataAccess.GetTableByMaster(ps_MasterInvoiceOrder);
    }

    [WebMethod]
    public DataTable GetTableByType(string ps_ActiveTransaction)
    {

        return objDataAccess.GetTableByType(ps_ActiveTransaction);
    }

    [WebMethod]
    public void Lock(string ps_UserName, object ps_InvoiceOrder, bool pb_Locked)
    {
        object[] arr = Validator.Validate(ps_InvoiceOrder);
        objDataAccess.Lock(ps_UserName, arr[0], pb_Locked);
    }

    [WebMethod]
    public bool NumberExisted(string ps_Subsidiary, bool pb_CheckNewRow, string ps_InvoiceOrder, object ps_So_Ct0, object ps_So_Seri0)
    {
        object[] arr = Validator.Validate(ps_So_Ct0, ps_So_Seri0);
        return objDataAccess.NumberExisted(ps_Subsidiary, pb_CheckNewRow, ps_InvoiceOrder, arr[0], arr[1]);
    }

    [WebMethod]
    public bool Save(bool pb_InvoiceHistory, bool pb_NewChecked, string ps_Subsidiary, string ps_UserName, string ps_MasterInvoiceOrder, string ps_Loai_Ps, DataTable po_Row)
    {

        return objDataAccess.Save(pb_InvoiceHistory, pb_NewChecked, ps_Subsidiary, ps_UserName, ps_MasterInvoiceOrder, ps_Loai_Ps, po_Row.Rows[0]);
    }

    [WebMethod]
    public void So_Seri_Get(string ps_Subsidiary, string ps_InvoiceCode, object pd_Ngay_Ct, string ps_InvoiceOrder, ref object ps_So_Seri0, ref object ps_Mau_So0)
    {
        object[] arr = Validator.Validate(pd_Ngay_Ct, ps_So_Seri0, ps_Mau_So0);
        objDataAccess.So_Seri_Get(ps_Subsidiary, ps_InvoiceCode, arr[0], ps_InvoiceOrder, ref  ps_So_Seri0, ref  ps_Mau_So0);
    }
}